
<style>
    #report_table_view td, #report_table_view th {
        /*font-size: 11px;*/
        padding: 7px;
    }
</style>

<div class="header b-b bg-white-only">
    <div class="row">
        <div class="col-lg-2">
            <h4 class="m-t m-b-none">Reports</h4>
        </div>

        <div class="col-lg-4">
            <span class="m-t" style="display: inline-block;"><b>Show data for</b>: </span>
            <div class="select btn-group" data-resize="auto" id="category_select">
                <button class="btn btn-sm btn-success dropdown-toggle m-t-n-xxs" data-toggle="dropdown" style="width: 220px; overflow: hidden;">
                    <i class="fa fa-dot-circle-o pull-left m-l-xs"></i>
                    <span class="dropdown-label pull-left text-left text-ellipsis"></span>
                    <i class="fa fa-caret-down pull-right"></i>
                </button>
                <ul class="dropdown-menu">
                    <li data-value="-1" data-add-label="Member"> 
                        <a href="#">
                            <i class="fa fa-dot-circle-o"></i>
                            All Members
                        </a>
                    </li>

                    <?php
                    $default_id = -1;
                    foreach ($member_categories as $category) {
                        $selected = "";
                        if ($category['category']['default'] == "1") {
                            $selected = "data-selected='true'";
                            $default_id = $category['category']['id'];
                        }
                        ?>
                        <li data-value="<?php echo $category['category']['id']; ?>" data-add-label="<?php echo isset($category['settings']['add_type_label']) ? $category['settings']['add_type_label'] : 'Member'; ?>" <?php echo $selected; ?> > 
                            <a href="#">
                                <i class="fa fa-dot-circle-o"></i>
                                <?php echo $category['category']['name']; ?>
                            </a>
                        </li>
                    <?php } ?>
                </ul>
            </div>


            <input type="hidden" id="report_member_category_id" value="<?php echo $default_id; ?>" />
        </div>

        <div class="col-sm-6">
            <div class="m-t-sm">
                <div class="btn-group pull-right" id="export_btn" data-url="<?php echo $this->Html->url(array('action' => 'export')); ?>">
                    <button class="btn btn-white btn-sm dropdown-toggle" disabled="" data-toggle="dropdown">
                        <i class="fa fa-cloud-download"></i> Export
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu pull-right">
                        <li><a href="#" data-type="csv"><i class="fa fa-list"></i> Microsoft Excel</a></li>
                        <!--<li><a href="#" data-type="pdf"><i class="fa fa-list-alt"></i> Adobe PDF</a></li>-->
                    </ul>
                </div>

                <div class="btn-group pull-right m-r-sm">
                    <button href="<?php echo $this->Html->url(array('action' => 'printout')); ?>" disabled="" class="btn btn-default btn-sm" id="print_btn">
                        <i class="fa fa-print"></i> Print
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="wrapper">                

    <section class="panel">
        <header class="panel-heading font-bold hbox stretch">
            <aside class="aside-md">Reports</aside>
            <aside class="aside-md">Report Parameters</aside>
            <aside class="">
                <div class="col-lg-6" id="report_title">Report Title And Results</div>
                <div class="col-lg-6">


                </div>
            </aside>
        </header>
        <div class="panel-body no-padder">
            <section  class="hbox stretch">
                <aside class="aside-md b-r">
                    <div class="wrapper">
                        <?php echo $this->element('organisation/reports_list'); ?>
                    </div>
                </aside>

                <aside class="aside-md b-r" id="parameters-column">

                </aside>

                <aside class="scrollable" id="report_results">
                    <div class="col-lg-12" id="report_view_area" class="clearfix">
                        <div class="m-xl text-muted h4 text-center">
                            <i class="fa fa-info-circle fa-2x fa-stack"></i> Choose a report type on the left to load the configuration and viewer window here
                        </div>
                    </div>
                </aside>
            </section>
        </div>
    </section>
</div>


<input type="hidden" id="generate_report_url" value="<?php echo $this->Html->url(array('controller' => 'reports', 'action' => 'generate')); ?>" />
<input type="hidden" id="groups_data_url" value="<?php echo $this->Html->url(array('controller' => 'reports', 'action' => 'groups')); ?>" />
<input type="hidden" id="groups_report_url" value="<?php echo $this->Html->url(array('controller' => 'reports', 'action' => 'view', 10)); ?>" />
<input type="hidden" id="dates_report_url" value="<?php echo $this->Html->url(array('controller' => 'reports', 'action' => 'view', 11)); ?>" />
<input type="hidden" id="search_column_settings_url" value="<?php echo $this->Html->url(array('controller' => 'reports', 'action' => 'column_settings')); ?>" />
<input type="hidden" id="search_columns_save_url" value="<?php echo $this->Html->url(array('controller' => 'reports', 'action' => 'save_column_settings')); ?>" />

<?php
echo $this->Html->script('app/models/member.js');
echo $this->Html->script('app/views/organisations/reports.js');
?>



